<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2021/5/1
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">



    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->

<%--    <script src="doctor/js/doctor.js" type="text/javascript"></script> 触发了2次所以注释--%>
</head>
<body>
<%
    //获取项目的根路径
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script src="<%=basePath%>doctor/js/jquery-1.12.4.js" type="text/javascript" ></script>
<script src="<%=basePath%>doctor/js/doctor.js" ></script>
<link rel="stylesheet" href="<%=basePath%>doctor/css/doctor.css">
<link rel="stylesheet" href="<%=basePath%>layui-v2.6.5/layui/css/layui.css" media="all">
<script src="<%=basePath%>layui-v2.6.5/layui/layui.js" type="text/javascript"></script>
<link rel="stylesheet" href="<%=basePath%>swee/sweetalert.css">
<script src="<%=basePath%>swee/sweetalert-dev.js"></script>
<div >
<ul class="doctor">
    <li>
       <p><button class="layui-btn layui-btn-primary layui-border-green"  class="qq">候诊患者列表</button></p>
        <div class="layui-form">
            <form action="<%=basePath%>queue" method="post">
                <input type="text" name="name" lay-verify="email" autocomplete="off" class="name" >
                <button type="submit" id="select" class="layui-btn layui-btn-radius" name="nameselect">查询</button>
<%----%>
                <button type="submit" id="selectall" class="layui-btn layui-btn-radius" name="selectall" value="selectall">查看历史诊断列表</button>
            </form>

            <table class="layui-table" lay-even="" lay-skin="row">
                <colgroup>
                    <col width="150">
                    <col width="150">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>诊断号</th>
                    <th>名字</th>
                    <th>医生</th>
                    <th>挂号时间</th>
                    <th>操作</th>

                </tr>
                </thead>
                <tbody class="bangding">
                <c:forEach items="${requestScope.page.newsList}" var="list">
                    <tr >
                        <td>${list.id}</td>
                        <td>${list.patientId}</td>
                        <td>${list.patientName}</td>
                        <td>${list.doctorName}</td>
                        <td>${list.time}</td>
                        <c:if test="${state==null}">
                             <td> <button type="button" id="ok" class="layui-btn layui-btn-radius">确认问诊</button></td>
                        </c:if>
                        <c:if test="${state!=null}">
                            <td>
                                <c:if test="${state!=null}">
                                    <c:if test="${list.state==0}">
                                        <button type="button" class="layui-btn layui-btn-radius">未确诊</button>
                                    </c:if>
                                    <c:if test="${list.state==1}">
                                        <button type="button" class="layui-btn layui-btn-warm layui-btn-radius">问诊中</button>
                                    </c:if>
                                    <c:if test="${list.state==2}">
                                        <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">已确诊</button>
                                    </c:if>

                                </c:if>
                            </td>
                        </c:if>


                    </tr>
                </c:forEach>
                </tbody>
            </table>



                <span id="qiehuan" colspan="8" align="center">
                      <c:if test="${state==null}">
                          <c:if test="${requestScope.page.currPageNo>1}" >
                        <a href="<%=basePath%>queue?currentPage=${requestScope.page.currPageNo-1}&name=${name}">
                            <button class="layui-btn layui-btn-primary layui-border-green">上一页</button>
                        </a>
                          </c:if>
                          <c:if test="${requestScope.page.currPageNo<requestScope.page.totalPageCount}" >
                        <a href="<%=basePath%>queue?currentPage=${requestScope.page.currPageNo + 1}&name=${name}">
                            <button class="layui-btn layui-btn-primary layui-border-green">下一页</button>
                        </a>
                          </c:if>
                      </c:if>
            <c:if test="${state!=null}">
                    <c:if test="${requestScope.page.currPageNo>1}" >
                        <a href="<%=basePath%>queue?currentPage=${requestScope.page.currPageNo-1}&name=${name}&selectall=selectall">
                            <button class="layui-btn layui-btn-primary layui-border-green">上一页</button>
                        </a>
                    </c:if>
                    <c:if test="${requestScope.page.currPageNo<requestScope.page.totalPageCount}" >
                        <a href="<%=basePath%>queue?currentPage=${requestScope.page.currPageNo + 1}&name=${name}&selectall=selectall">
                            <button class="layui-btn layui-btn-primary layui-border-green">下一页</button>
                        </a>
                    </c:if>
            </c:if>
                </span>
        </div>
    </li>
    <li>
        <p><button class="layui-btn layui-btn-primary layui-border-green"  class="qq">当前患者详细信息</button></p>
        <div>
            <iframe src="DoctorServlet" frameborder="0" width="100%" height="600px">

            </iframe>
        </div></li>
    <li>
        <p><button class="layui-btn layui-btn-primary layui-border-green"  class="qq">查看药单</button></p>
        <div>
            <iframe src="MedicineServlet" frameborder="0" width="100%" height="600px">

            </iframe>

        </div>
    </li>
</ul>
</div>
</body>






</html>
